Algo Flitf Functions

ee_status EE_FLITF_Init ( ee_object_t * object , ee_erase_type erase_type )

Restore the pages to a known good state in case of power loss. If a page is in REMOVED state, resume the page remove operation. Then if some pages are in ERASING state, erase these pages.

Processing

The following graph shows the processing of EE_FLITF_Init:

Parameters :
  • object – pointer on eeprom_emulation object

  • erase_type – ee_erase_type Type of erase to apply on pages requiring an erase operation.

Return values :

ee_status – Refer to ee_status for possible return values

ee_status EE_FLITF_Format ( ee_erase_type erase_type )

Erases all flash pages of eeprom emulation and sets the first page header as ACTIVE.

Processing

The following graph shows the processing of EE_FLITF_Format:

Note

This function can be called the very first time eeprom emulation is used to prepare flash pages for eeprom emulation with empty eeprom variables. It can also be called at any time to flush all eeprom variables.

Parameters :

erase_type – ee_erase_type Type of erase to apply on pages requiring an erase operation.

Return values :

ee_status – Refer to ee_status for possible return values

ee_status EE_FLITF_ReadVariable96bits ( uint16_t virt_address , uint64_t * p_data )

Returns the last stored variable data corresponding to the passed virtual address.

Processing

The following graph shows the processing of EE_FLITF_ReadVariable96bits:

Parameters :
  • virt_address – Variable virtual address on 16 bits (cannot be 0x0000 or 0xFFFF)

  • p_data – 96-bit data to be written, pointed to by a uint64_t pointer

Return values :

ee_status – Refer to ee_status for possible return values

ee_status EE_FLITF_ReadVariable32bits ( uint16_t virt_address , uint32_t * p_data )

Returns the last stored variable data corresponding to the passed virtual address.

Processing

The following graph shows the processing of EE_FLITF_ReadVariable32bits:

Parameters :
  • virt_address – Variable virtual address on 16 bits (cannot be 0x0000 or 0xFFFF).

  • p_data – Variable containing the 32-bit read variable value.

Return values :

ee_status – Refer to ee_status for possible return values.

ee_status EE_FLITF_ReadVariable16bits ( uint16_t virt_address , uint16_t * p_data )

Returns the last stored variable data, if found, which correspond to the passed virtual address.

Processing

The following graph shows the processing of EE_FLITF_ReadVariable16bits:

Parameters :
  • virt_address – Variable virtual address on 16 bits (can’t be 0x0000 or 0xFFFF)

  • p_data – Variable containing the 16bits read variable value

Return values :

ee_status – ee_status

ee_status EE_FLITF_ReadVariable8bits ( uint16_t virt_address , uint8_t * p_data )

Returns the last stored variable data corresponding to the passed virtual address.

Processing

The following graph shows the processing of EE_FLITF_ReadVariable8bits:

Parameters :
  • virt_address – Variable virtual address on 16 bits (cannot be 0x0000 or 0xFFFF)

  • p_data – Variable containing the 8-bit read variable value

Return values :

ee_status – Refer to ee_status for possible return values

ee_status EE_FLITF_WriteVariable96bits ( uint16_t virt_address , const uint64_t * p_data )

Writes/updates variable data in EEPROM. Triggers internal pages transfer if half of the pages are full.

Warning

This function is not reentrant.

Parameters :
  • virt_address – Variable virtual address on 16 bits (cannot be 0x0000 or 0xFFFF).

  • p_data – 96-bit data to be written, pointed to by a uint64_t pointer.

Return values :

ee_status – Refer to ee_status for possible return values.

ee_status EE_FLITF_WriteVariable32bits ( uint16_t virt_address , uint32_t data )

Writes/updates variable data in EEPROM. Triggers internal pages transfer if half of the pages are full.

Processing

The following graph shows the processing of EE_FLITF_WriteVariable32bits:

Warning

This function is not reentrant.

Parameters :
  • virt_address – Variable virtual address on 16 bits (cannot be 0x0000 or 0xFFFF).

  • data – 32-bit data to be written.

Return values :

ee_status – Refer to ee_status for possible return values.

ee_status EE_FLITF_WriteVariable16bits ( uint16_t virt_address , uint16_t data )

Writes/updates variable data in EEPROM. Triggers internal pages transfer if half of the pages are full.

Processing

The following graph shows the processing of EE_FLITF_WriteVariable16bits:

Warning

This function is not reentrant.

Parameters :
  • virt_address – Variable virtual address on 16 bits (cannot be 0x0000 or 0xFFFF).

  • data – 16-bit data to be written.

Return values :

ee_status – Refer to ee_status for possible return values.

ee_status EE_FLITF_WriteVariable8bits ( uint16_t virt_address , uint8_t data )

Writes/updates variable data in EEPROM. Triggers internal pages transfer if half of the pages are full.

Processing

The following graph shows the processing of EE_FLITF_WriteVariable8bits:

Warning

This function is not reentrant.

Parameters :
  • virt_address – Variable virtual address on 16 bits (cannot be 0x0000 or 0xFFFF)

  • data – 8-bit data to be written.

Return values :

ee_status – Refer to ee_status for possible return values.

ee_status EE_FLITF_CleanUp ( void )

Erase a group of pages that are in erasing state, in polling mode. The group could be either the first half or the second half of the total number of pages.

Processing

The following graph shows the processing of EE_FLITF_CleanUp:

Note

This function must be called when EE_WriteVariableXXbits has returned EE_CLEANUP_REQUIRED status (and only in that case).

Return values :

ee_status – Refer to ee_status for possible return values.

ee_status EE_FLITF_CleanUpProgressive ( void )

Erase the latest valid page progressively, in polling mode. The data still in use are transferred to the active page in bounded time slices (budget EE_CLEANUP_PROGRESSIVE_TIME_MS milliseconds), then the page is physically erased. The function can therefore be called repeatedly from the application main loop without blocking time-critical processing for the whole cleanup duration.

Note

This function must be called when EE_WriteVariableXXbits has returned EE_INFO_CLEANUP_REQUIRED status (and only in that case). It must be called again as long as it returns EE_INFO_CLEANUP_REQUIRED.

Return values :

ee_status –

  • EE_OK: cleanup is complete, no more call required

  • EE_INFO_CLEANUP_REQUIRED: cleanup ongoing, the function must be called again

  • EE error code: if an error occurs

ee_status EE_FLITF_CleanUp_IT ( ee_operation_callback_t operation_complete )

Erase a group of pages that are in erasing state, in interrupt mode. The group could be either the first half or the second half of the total number of pages.

Processing

The following graph shows the processing of EE_FLITF_CleanUp_IT:

Note

if operation_complete is NULL the status call be read with API EE_FLITF_GetStatusCleanUp_IT

Note

This function must be called when EE_WriteVariableXXbits has returned EE_CLEANUP_REQUIRED status (and only in that case).

Parameters :

operation_complete – callback used to return operation status

Return values :

ee_status – Refer to ee_status for possible return values.

ee_operation_status EE_FLITF_GetStatusCleanUp_IT ( void )

return the status of cleanup interrupt operation.

Processing

The following graph shows the processing of EE_FLITF_GetStatusCleanUp_IT():

Note

This function must be called when EE_FLITF_CleanUp_IT to control the end of the operation and before any new eeprom operation.

Return values :

ee_operation_status – Refer to ee_operation_status for possible return values.